<script type="text/ng-template" id="page.property.edit.html">
  <input type="file" style="display:none;" id="fileuploader"/>
  <form class="form-horizontal">
        <div class="modal-header">
            <h3 class="modal-title">{{title}}</h3>
        </div>
        <div class="modal-body">
          <div ng-if="isTopic == true">
          <div class="form-group">
            <label class="col-sm-2 control-label">开始时间</label>
            <div class="col-sm-10">
              <div class=' input-group date' ng-init="initTime()">
                          <input type='text' class="form-control datetimepicker datetimepicker1" ng-model="topic.starttime" ng-blur="dateChange(topic,1)" />
                          <span class="input-group-addon">
                      <span class="glyphicon glyphicon-calendar"></span>
                          </span>
                      </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">结束时间</label>
            <div class="col-sm-10">
              <div class=' input-group date' ng-init="initTime()">
                          <input type='text' class="form-control datetimepicker datetimepicker2" ng-model="topic.endtime" ng-blur="dateChange(topic,2)" />
                          <span class="input-group-addon">
                      <span class="glyphicon glyphicon-calendar"></span>
                          </span>
                      </div>
            </div>
          </div>
          <!-- <div class="form-group">
            <label class="col-sm-2 control-label">专题banner</label>
            <div class="col-sm-10">
              <div class="input-group">
                <input type="text" class="form-control" ng-model="topic.fileName">
                <span class="input-group-btn">
                  <button class="btn btn-default" ng-click="changeFile(topic)" tabindex="0">
                  <i class="glyphicon glyphicon-folder-open"></i>
                  </button>
                  <button class="btn btn-success" tabindex="0" ng-if="topic.isCompleted">
                  <i class="glyphicon glyphicon-ok"></i>
                  </button>
                </span>
              </div>
            </div>
          </div> -->
          <div class="form-group">
            <label class="col-sm-2 control-label">专题状态</label>
            <div class="col-sm-10">
                  <select class="form-control" ng-model="topic.status">
                     <option value="0">下线</option>
                     <option value="1">上线</option>
                  </select>
            </div>
          </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">页面类型</label>
            <div class="col-sm-10">
              <select class="form-control" ng-disabled="{{isEdit}}" ng-model="page.pageType" ng-options="opt.value as opt.name for opt in pageTypes" ng-change="findHeader(page.pageType)">
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">页面名称</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" ng-model="page.pageName" ng-readonly="{{isEdit}}" autofocus ng-if="!isEdit">
              <input type="text" class="form-control" ng-model="page.pageName" ng-readonly="{{isEdit}}" ng-if="isEdit">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">头部选项</label>
            <div class="col-sm-10">
              <select class="form-control" ng-model="page.header" ng-options="opt.name as opt.description for opt in headers" ng-init="findHeader(page.pageType)">
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" ng-model="page.title" ng-if="!isEdit">
              <input type="text" class="form-control" ng-model="page.title" ng-if="isEdit" autofocus onfocus="this.select()">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">关键词</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" ng-model="page.keywords">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">描述</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" ng-model="page.description">
            </div>
          </div>
          <hr>
          <div class="form-group">
            <label class="col-sm-2 control-label">背景填充色</label>
            <div class="col-sm-10">
                <input type="color" class="form-control" placeholder="#F5F5F5" ng-model="page.pageConfig.backgroundColor">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">背景填充图</label>
            <div class="col-sm-10">
              <div class="input-group">
                <input type="text" class="form-control" ng-model="page.pageConfig.backgroundUrl">
                <span class="input-group-btn">
                  <button class="btn btn-default" ng-click="changeFile('backgroundUrl')" tabindex="0">
                  <i class="glyphicon glyphicon-folder-open"></i>
                  </button>
                  <button class="btn btn-success" tabindex="0" ng-if="page.isBackgroundUrlCompleted">
                  <i class="glyphicon glyphicon-ok"></i>
                  </button>
                </span>
              </div>
            </div>
          </div>
          <div class="form-group" ng-if="page.pageType!=0">
            <label class="col-sm-2 control-label">微信分享图标</label>
            <div class="col-sm-10">
              <div class="input-group">
                <input type="text" class="form-control" ng-model="page.pageConfig.shareIcon">
                <span class="input-group-btn">
                  <button class="btn btn-default" ng-click="changeFile('shareIcon')" tabindex="1">
                  <i class="glyphicon glyphicon-folder-open"></i>
                  </button>
                  <button class="btn btn-success" tabindex="1" ng-if="page.isShareIconCompleted">
                  <i class="glyphicon glyphicon-ok"></i>
                  </button>
                </span>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-success" ng-click="save(topic)" type="submit">保存</button>
            <button class="btn btn-default" ng-click="cancel()">取消</button>
        </div>
  </form>
</script>
